import React from 'react'
import Admin from './pages/admin'
import Login from './pages/login'
import {Switch,Route,Redirect} from 'react-router-dom'

import { Provider } from 'react-redux'
import store from './store'
import yztoken from './utils/yztoken'

function App() {
  return (<Provider store={store}>
    <div>
      <Switch>
        <Route path='/admin' component={Admin} />
        <Route path='/login' component={Login} />
        <Redirect from='/' to='/admin' />
      </Switch>
    </div>
    </Provider>
  )
}
export default  yztoken(App)